<template>
	<el-input
		v-model="fieldValue"
		:maxlength="$attrs.type === 'textarea' ? 255 : 100"
		:formatter="(val) => val.replace(/\//gi, '').trim()"
		:size="$store.user.size"
		clearable
		v-bind="$attrs"
	>
		<template v-for="(slotKey, slotIndex) in slots" :key="slotIndex" v-slot:[slotKey]>
			<slot :name="slotKey"></slot>
		</template>
	</el-input>
</template>

<script setup name="MyInput">
import { useVModel } from '@vueuse/core'
const props = defineProps({
		modelValue: {
			type: String
		}
	}),
	slots = Object.keys(useSlots()),
	emit = defineEmits(['update:modelValue']),
	fieldValue = useVModel(props, 'modelValue', emit)
</script>
